cmake_minimum_required(VERSION 3.10)
project(serial_process)

set(CMAKE_CXX_SIMULATE 17)

add_subdirectory(serial)
add_subdirectory(protocol)
add_subdirectory(serial_data)

find_package(catkin REQUIRED COMPONENTS
        msg_process
        unitree_legged_msgs
        roscpp
        std_msgs
        geometry_msgs
        message_generation
        )


generate_messages(
        DEPENDENCIES
        std_msgs
        geometry_msgs
)

catkin_package(
        CATKIN_DEPENDS
        roscpp
        std_msgs
)

include_directories(
        include
        ${catkin_INCLUDE_DIRS}
)

add_executable(receive_process receive_process.cpp )
add_executable(send_process send_process.cpp)

add_dependencies(receive_process ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_generate_messages_cpp)
add_dependencies(send_process ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_generate_messages_cpp)

target_link_libraries(receive_process ${catkin_LIBRARIES}  serial_data)
target_link_libraries(send_process ${catkin_LIBRARIES}  serial_data)